<!-- COMMENT -->
<?php
$commontNum = 0;
?>
<div class="feedback" id="comment">
	<div class="fbHeader">
		<h2>{$lang->comment} <em>{$oDocument->getCommentcount()}</em></h2>
	</div>
	<ul cond="$oDocument->getCommentcount()" class="fbList">
		<li loop="$oDocument->getComments()=>$key,$comment" class="fbItem"|cond="!$comment->get('depth')" class="fbItem indent indent{($comment->get('depth'))} parent_{$comment->parent_srl}"|cond="$comment->get('depth')" id="comment_{$comment->comment_srl}">
		<!--@if(!$comment->get('depth'))-->
    	{@ $commontNum++; }
		<!--@end-->
			<div cond="!$comment->get('depth')" style="height:1px;width:100%;background-color:#CCC;margin-bottom: 10px;"></div>

			<div class="fbMeta" >
				<span cond="!$comment->get('depth')" style="float:left; font-size: 15px;font-weight: bold;">{(($oDocument->getCommentListPageCount() * ($cpage - 1)) + $commontNum)}&nbsp;</span>
				<img cond="$comment->getProfileImage()" src="{$comment->getProfileImage()}" alt="Profile" class="profile" />
				<span cond="!$comment->getProfileImage()" class="profile"></span>
				<table>
					<tr>
						<td width="25px">
						<img cond="$comment->country" src="/images/{$comment->getCountry()}.png" style="float:left" width="24px"/>
						</td>
						<td>
							<a cond="!$comment->member_srl && $comment->homepage"  href="{$comment->getHomepageUrl()}">{$comment->getNickName()}</a>
							<strong cond="!$comment->member_srl && !$comment->homepage" >{$comment->getNickName()}</strong>
							<a cond="$comment->member_srl" href="#popup_menu_area" class="member_{$comment->member_srl}" onclick="return false">{$comment->getNickName()}</a>
						</td>
					</tr>
					<tr>
					<td align="center">
					<strong class="time"> </strong>
						<strong class="time">{geoip_country_code_by_name($comment->getFullIpAddress())}</strong>
					</td>
					<td>
						<strong class="time">ID:{$comment->getAutoID()}</strong>
					</td>

					</tr>
					<tr>
						<td colspan="2">
							<p class="time">{$comment->getRegdate('Y.m.d H:i')}</p>
						</td>
					</tr>
				</table>



			</div>
			<!--@if(!$comment->isAccessible())-->
			<form action="./" method="get" class="xe_content" onsubmit="return procFilter(this, input_password)">
				<p><label for="cpw_{$comment->comment_srl}">{$lang->msg_is_secret} {$lang->msg_input_password}</label></p>
				<p><input type="password" name="password" id="cpw_{$comment->comment_srl}" class="iText" /><input type="submit" class="btn" value="{$lang->cmd_input}" /></p>
				<input type="hidden" name="mid" value="{$mid}" />
				<input type="hidden" name="page" value="{$page}" />
				<input type="hidden" name="document_srl" value="{$comment->get('document_srl')}" />
				<input type="hidden" name="comment_srl" value="{$comment->get('comment_srl')}" />
			</form>
			<!--@else-->
			<div id="comment_text_{$comment->comment_srl}">
				<div id="parent_{$comment->parent_srl}_{$comment->getCountry()}">
				{$comment->getContent(false)}
				</div>
			</div>

			<!--@if(!$comment->get('depth'))-->
			<div id="anchor_{(($oDocument->getCommentListPageCount() * ($cpage - 1)) + $commontNum)}" style="display:none;">
			{$comment->getContent(false)}
			</div>
			<div id="anchor_name_{(($oDocument->getCommentListPageCount() * ($cpage - 1)) + $commontNum)}" style="display:none;">
			{$comment->getNickName()}
			</div>
			<div id="anchor_time_{(($oDocument->getCommentListPageCount() * ($cpage - 1)) + $commontNum)}" style="display:none;">
			{$comment->getRegdate('Y.m.d H:i')}
			</div>
			<!--@end-->
			<!--@end-->
			<div cond="$comment->hasUploadedFiles()" class="fileList">
				<button type="button" class="toggleFile" onclick="jQuery(this).next('ul.files').toggle();">{$lang->uploaded_file} [<strong>{$comment->get('uploaded_count')}</strong>]</button>
				<ul class="files">
					<li loop="$comment->getUploadedFiles()=>$key,$file"><a href="{getUrl('')}{$file->download_url}">{$file->source_filename} <span class="fileSize">[File Size:{FileHandler::filesize($file->file_size)}/Download:{number_format($file->download_count)}]</span></a></li>
				</ul>
			</div>
			<p class="action">
				<span class="vote" cond="$comment->get('voted_count')!=0">{$lang->cmd_vote}:{$comment->get('voted_count')?$comment->get('voted_count'):0}</span>
				<span class="vote" cond="$comment->get('blamed_count')!=0">{$lang->cmd_vote_down}:{$comment->get('blamed_count')?$comment->get('blamed_count'):0}</span>

				<a cond="!$comment->get('depth')" href="javascript:autoTrans({$comment->comment_srl},'japan',this);"  class="reply" id="{$comment->comment_srl}_japan">{$lang->cmd_translation_japan}</a>
				<a cond="!$comment->get('depth')" href="javascript:autoTrans({$comment->comment_srl},'china',this);" class="reply" id="{$comment->comment_srl}_china">{$lang->cmd_translation_china}</a>
				<a cond="!$comment->get('depth')" href="javascript:autoTrans({$comment->comment_srl},'korea',this);" class="reply" id="{$comment->comment_srl}_korea">{$lang->cmd_translation_korea}</a>

				<a cond="$oDocument->allowComment() && !$comment->get('depth')" href="javascript:showTransList('{$comment->comment_srl}');" class="reply">[{$comment->getChildCommentCount($comment->comment_srl)}]{$lang->cmd_translation_layer}</a>
				<!--返信が1段階以下は出来ないように  -->



				<a cond="$is_logged && !$comment->get('depth')" href="{getUrl('act','dispBoardReplyComment','comment_srl',$comment->comment_srl)}" class="reply">{$lang->cmd_translation}</a>

<!--
				<a href="javascript:autoTrans({$comment->comment_srl},'japan','china',this);"  class="reply" id="{$comment->comment_srl}_japan_china">日->中</a>
				<a href="javascript:autoTrans({$comment->comment_srl},'japan','korea',this);"  class="reply" id="{$comment->comment_srl}_japan_korea">日->韓</a>
				<a href="javascript:autoTrans({$comment->comment_srl},'china','japan',this);"  class="reply" id="{$comment->comment_srl}_china_japan">中->日</a>
				<a href="javascript:autoTrans({$comment->comment_srl},'china','korea',this);"  class="reply" id="{$comment->comment_srl}_china_korea">中->韓</a>
				<a href="javascript:autoTrans({$comment->comment_srl},'korea','japan',this);"  class="reply" id="{$comment->comment_srl}_korea_japan">韓->日</a>
				<a href="javascript:autoTrans({$comment->comment_srl},'korea','china',this);"  class="reply" id="{$comment->comment_srl}_korea_china">韓->中</a>
 -->

				<a cond="$grant->manager" href="{getUrl('act','dispBoardModifyComment','comment_srl',$comment->comment_srl)}" class="modify">{$lang->cmd_modify}</a>
				<a cond="$grant->manager" href="{getUrl('act','dispBoardDeleteComment','comment_srl',$comment->comment_srl)}" class="delete">{$lang->cmd_delete}</a>
				<a cond="$is_logged" class="comment_{$comment->comment_srl} this" href="#popup_menu_area" onclick="return false">{$lang->cmd_comment_do}</a>
			</p>
		</li>
	</ul>
    <div cond="$oDocument->comment_page_navigation" class="pagination">
        <a href="{getUrl('cpage',1)}#comment" class="direction prev"><span></span><span></span> {$lang->first_page}</a>
        <block loop="$page_no=$oDocument->comment_page_navigation->getNextPage()">
			<strong cond="$cpage==$page_no">{$page_no}</strong>
			<a cond="$cpage!=$page_no" href="{getUrl('cpage',$page_no)}#comment">{$page_no}</a>
        </block>
        <a href="{getUrl('cpage',$oDocument->comment_page_navigation->last_page)}#comment" class="direction next">{$lang->last_page} <span></span><span></span></a>
    </div>
	<form cond="$grant->write_comment && $oDocument->isEnableComment()" action="./" method="post" onsubmit="return procFilter(this, insert_comment)" class="write_comment" id="write_comment">
		<input type="hidden" name="mid" value="{$mid}" />
		<input type="hidden" name="document_srl" value="{$oDocument->document_srl}" />
		<input type="hidden" name="comment_srl" value="" />
		<input type="hidden" name="password" value="temp" />
		<input id="parent_srl" name="parent_srl" type="hidden" value=""/>




		<input id="hdn_content" type="hidden" name="content" value="" />
        {$oDocument->getCommentEditor()}



		<div class="write_author" style="width:355px">
			<span class="item" cond="!$is_logged">
				<label for="userName" class="iLabel">{$lang->writer}</label>
				<input type="text" name="nick_name" id="userName" class="iText userName" />
			</span>
			<span class="item" cond="$is_logged">
				<input type="hidden" name="nick_name" id="userName" class="iText userName" />
			</span>
			<!--
			<span class="item" cond="!$is_logged">
				<label for="userPw" class="iLabel">{$lang->password}</label>
				<input type="password" name="password" id="userPw" class="iText userPw" />
			</span>
			 -->
			<span class="item" cond="!$is_logged">
				<label for="homePage" class="iLabel">{$lang->homepage}</label>
				<input type="text" name="homepage" id="homePage" class="iText homePage" />&nbsp;
			</span>
			<span>
			<br>
			<input type="radio" id="rad_country_japan" name="country" value="japan">
        	<img src="/images/japan.png">
        	&nbsp;&nbsp;<input type="radio" id="rad_country_china" name="country" value="china" >
        	<img src="/images/china.png">
        	&nbsp;&nbsp;<input type="radio" id="rad_country_korea" name="country" value="korea">
        	<img src="/images/korea.png">
        	&nbsp;&nbsp;<input type="radio" id="rad_country_hongkong" name="country" value="hongkong">
        	<img src="/images/hongkong.png" width="24px">
        	&nbsp;&nbsp;<input type="radio" id="rad_country_taiwan" name="country" value="taiwan">
        	<img src="/images/taiwan.png">
        	&nbsp;&nbsp;<input type="radio" id="rad_country_world" name="country" value="world">
        	<img src="/images/world.png">
        	</span>
        	<span>
        	<input type="checkbox" name="new_comment_type" value="Y" id="new_comment_type" class="iCheck" />
			<label>{$lang->new_comment_type}</label>
			</span>

			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<input cond="$is_logged" type="checkbox" name="notify_message" value="Y" id="notify_message" class="iCheck" />
			<label cond="$is_logged" for="notify_message">{$lang->notify}</label>
			<input cond="$module_info->secret=='Y'" type="checkbox" name="is_secret" value="Y" id="is_secret" class="iCheck" />
			<label cond="$module_info->secret=='Y'" for="is_secret">{$lang->secret}</label>
		</div>
		<!--  <textarea name="content" value="" class="iText1"  cols="40" rows="5"></textarea>-->
		<div class="btnArea">
			<button type="submit" class="btn">{$lang->cmd_comment_registration}</button>
		</div>
	</form>
	{$lang->disp_middle_text}
</div>
<div class="fbFooter">
	<a href="{getUrl('document_srl','')}" class="btn">{$lang->cmd_list}</a>
</div>

<div id="anchor_popup_div" style="background-color: #DDD;z-index:1000; border: 1px solid #666; padding: 10px;"></div>
<!-- /COMMENT -->

